<template>
	<view :style="themeColor">
		<view class="page">
			<view class="flex benben-position-layout flex flex-wrap align-center pointsProductDetails_flex_0"
				:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
				<view class='flex flex-wrap align-center justify-between flex-sub pointsProductDetails_fd0_0'>
					<view class='flex flex-wrap align-center pointsProductDetails_fd0_0_c0' @tap.stop="handleJumpDiy"
						data-type="back" data-url="1">
						<text class='fu-iconfont2  pointsProductDetails_fd0_0_c0_c0'>&#xe794;</text>
					</view>
					<text class='pointsProductDetails_fd0_0_c1'>商品详情</text>
					<view class='flex flex-wrap align-center pointsProductDetails_fd0_0_c0'>
					</view>
				</view>

			</view>
			<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
			<!---商品信息flex布局开始-->
			<view class="flex flex-direction flex-wrap align-stretch benben-flex-layout pointsProductDetails_flex_1">
				<view style="position: relative">
					<swiper ref="benbenSwiperfd1_0" :current='slide' @change="bannerIndexfd1_0 = $event.detail.current"
						class='flex position-relative pointsProductDetails_fd1_0' previous-margin="0rpx"
						next-margin="0rpx" :display-multiple-items="1" :interval="5000" :duration="500" :autoplay='true'
						:circular='true'>

						<template v-for='(item,key0) in dataDetails.atlas'>
							<swiper-item class='flex  pointsProductDetails_fd1_0' :key='key0'>
								<image class='pointsProductDetails_fd1_0' mode="aspectFill" :src='item'></image>
							</swiper-item>
						</template>

					</swiper>
					<view style="position: absolute"
						class="flex dot flex align-center justify-center pointsProductDetails_swiperDotfd1_0">
						<view class='flex flex align-center justify-center pointsProductDetails_numberfd1_0_c0'>
							<text>{{bannerIndexfd1_0+1}}</text>
							<text>/</text>
							<text>{{(dataDetails.atlas.length)}}</text>
						</view>

					</view>
				</view>
				<view class='flex flex-direction flex-wrap align-stretch pointsProductDetails_fd1_1'>
					<text class='pointsProductDetails_fd1_1_c0'>{{dataDetails.name}}</text>
					<view class='flex flex-wrap align-center pointsProductDetails_fd1_1_c1'>
						<text class='pointsProductDetails_fd1_1_c1_c0'>{{dataDetails.integral}}</text>
						<text class='pointsProductDetails_fd1_1_c1_c1'>积分</text>
					</view>
				</view>
				<view class='flex flex-wrap align-center pointsProductDetails_fd1_2'>
					<view class='flex flex-wrap align-center pointsProductDetails_fd1_2_c0'>
					</view>
					<text class='pointsProductDetails_fd1_2_c1'>商品详情</text>
				</view>
				<jyf-parser class='pointsProductDetails_fd1_3' :html="dataDetails.describe | richTextFormat">
				</jyf-parser>
			</view>

			<!---商品信息flex布局结束-->
			<view
				class="flex flex-direction flex-wrap align-stretch benben-position-layout flex pointsProductDetails_flex_2">
				<view class='flex flex-wrap align-center justify-center pointsProductDetails_fd2_0'
					v-if=" dataDetails.integral>=userData.score">
					<text class='pointsProductDetails_fd2_0_c0'>积分不足</text>
					<text class='pointsProductDetails_fd2_0_c1'>(当前积分：</text>
					<text class='pointsProductDetails_fd2_0_c1'>{{userData.score}}</text>
					<text class='pointsProductDetails_fd2_0_c1'>)</text>
				</view>
				<button class='pointsProductDetails_fd2_1' @tap.stop="handleJumpDiy" data-type="navigateTo"
					:data-url="`/pages/integral/pointConfirmatOrder/pointConfirmatOrder?id=${dataDetails.aid}`"
					v-if=" dataDetails.integral<userData.score">立即兑换</button>

			</view>
			<view :style="{height: '108rpx'}"></view>


		</view>
	</view>
</template>
<script>
	import {
		validate
	} from '@/common/utils/validate.js'

	export default {
		components: {},


		data() {
			return {
				"bannerIndexfd1_0": 0,
				"dataDetails": {
					"aid": "",
					"create_time": "",
					"name": "",
					"describe": "",
					"good_code": "",
					"atlas": [],
					"inventory": "",
					"integral": "",
					"money": "",
					"exchange_num": "",
					"classify": "",
					"classify_name": ""
				},
				"userData": {
					"invite_code": "",
					"address": "",
					"address_code": "",
					"hobby": "",
					"tags": "",
					"id": "",
					"userlevel_id": "",
					"mobile": "",
					"real_name": "",
					"nickname": "",
					"avatar": "",
					"account": "",
					"email": "",
					"birthday": "",
					"gender": "",
					"create_time": "",
					"user_money": "",
					"freeze_money": "",
					"total_consumption_money": "",
					"score": "",
					"_mobile": "",
					"coupon": "",
					"collection_count": "",
					"browse_count": "",
					"total_money": "",
					"certified": "",
					"is_pay_password": "",
					"fuwuxingji": "",
					"gongzuozhuangtai": "",
					"shuzi": "",
					"jifen": "",
					"yajin": "",
					"level": {
						"aid": "",
						"name": "",
						"icon": "",
						"levelid": ""
					},
					"invite_num": "",
					"commission": "",
					"is_deposit": "",
					"is_account": "",
					"dengjidaoqishijian": "",
					"suozaidi": "",
					"huiyuanyue": "",
					"working_hours": "",
					"credit_score": "",
					"deposit": "",
					"deposit_switch": "",
					"withdrawal": "",
					"account_wx": "",
					"account_alipay": "",
					"account_bank": "",
					"joinin_state": ""
				},
				"slide": 0,
				"id": ""
			};
		},
		computed: {
			themeColor() {
				return this.$store.getters.themeColor
			},
			userInfo: {
				get() {
					return this.$store.state.userInfo
				},
				set() {
					this.$store.commit('updateUserInfo', value)
				},
			}
		},
		watch: {},
		onLoad(options) {
			let {
				id
			} = options
			if (id !== undefined) this.id = id
			this.DataDetailsFunc()
			this.getUserDataFunc()
		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {

		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {

		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {
			//获取商品详情
			async DataDetailsFunc() {
				//请求方法
				//数据验证

				let datadataDetails = await this.$api.get(global.apiUrls.post63c6016ec0317, {
					aid: this.id
				});

				if (datadataDetails.data.code != 1) {
					this.$message.info(datadataDetails.data.msg);
					return
				}
				let infodataDetails = datadataDetails.data;
				this.dataDetails = infodataDetails.data

			},
			//获取用户信息
			async getUserDataFunc() {
				//请求方法
				//数据验证

				let datauserData = await this.$api.get(global.apiUrls.post5c78c4772da97, {
					user_id: this.userInfo.id
				});

				if (datauserData.data.code != 1) {
					this.$message.info(datauserData.data.msg);
					return
				}
				let infouserData = datauserData.data;
				this.userData = infouserData.data

			}
		}
	};
</script>
<style lang="scss" scoped>
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: #fff;
		background-size: 100% auto;
	}

	.pointsProductDetails_flex_0 {
		background: #fff;
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background-size: 100% auto !important;
	}

	.pointsProductDetails_fd0_0_c1 {
		font-size: 36rpx;
		font-weight: 500;
		color: #333;
	}

	.pointsProductDetails_fd0_0_c0_c0 {
		font-size: 32rpx;
		color: #333;
	}

	.pointsProductDetails_fd0_0_c0 {
		width: 120rpx;
		height: 88rpx;
	}

	.pointsProductDetails_fd0_0 {
		padding: 0rpx 32rpx 0rpx 32rpx;
		height: 88rpx;
	}

	.pointsProductDetails_flex_1 {
		margin: 0rpx 0rpx 24rpx 0rpx;
	}

	::v-deep .pointsProductDetails_fd1_3 {
		width: 100%;
		padding: 0rpx 24rpx 0rpx 24rpx;
	}

	.pointsProductDetails_fd1_2_c1 {
		color: #333333;
		font-size: 32rpx;
		font-weight: 500;
		line-height: 38rpx;
	}

	.pointsProductDetails_fd1_2_c0 {
		background: rgba(230, 0, 54, 1);
		width: 7rpx;
		height: 30rpx;
		background-size: 100% auto !important;
		border-radius: 4rpx 4rpx 4rpx 4rpx;
		margin: 0rpx 8rpx 0rpx 0rpx;
	}

	.pointsProductDetails_fd1_2 {
		border-top: 10px solid rgba(248, 248, 248, 1);
		padding: 32rpx 24rpx 32rpx 24rpx;
	}

	.pointsProductDetails_fd1_1_c1_c1 {
		color: #333333;
		font-size: 22rpx;
		font-weight: 700;
		line-height: 36rpx;
		margin: 0rpx 0rpx 0rpx 8rpx;
	}

	.pointsProductDetails_fd1_1_c1_c0 {
		color: #F02325;
		font-size: 32rpx;
		font-weight: 700;
		line-height: 36rpx;
	}

	.pointsProductDetails_fd1_1_c1 {
		margin: 32rpx 0rpx 0rpx 0rpx;
	}

	.pointsProductDetails_fd1_1_c0 {
		line-height: 46rpx;
		font-size: 32rpx;
		font-weight: 700;
		color: #333333;
	}

	.pointsProductDetails_fd1_1 {
		margin: 32rpx 32rpx 32rpx 32rpx;
	}

	.pointsProductDetails_numberfd1_0_c0 {
		background: rgba(0, 0, 0, 0.5);
		position: absolute;
		bottom: 20rpx;
		right: 60rpx;
		width: 73rpx;
		height: 32rpx;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
		font-size: 24rpx;
		color: #FFFFFF;
		line-height: 46rpx;
		font-weight: 400;
	}

	.pointsProductDetails_fd1_0 {
		width: 750rpx;
		height: 750rpx;
	}

	.pointsProductDetails_swiperDotUnselectedfd1_0 {
		border: 1px solid rgba(0, 0, 0, 0.3);
		background: rgba(0, 0, 0, 0.3);
		width: 16rpx;
		height: 16rpx;
		border-radius: 100rpx 100rpx 100rpx 100rpx;
		margin: 0rpx 6rpx 0rpx 0rpx;
		font-size: 24rpx;
		color: #fff;
	}

	.pointsProductDetails_swiperDotSelectedfd1_0 {
		border: 1px solid #00A7FF;
		background: #00A7FF;
		width: 16rpx;
		height: 16rpx;
		border-radius: 100rpx 100rpx 100rpx 100rpx;
		margin: 0rpx 6rpx 0rpx 0rpx;
		font-size: 24rpx;
		color: #fff;
	}

	::v-deep .pointsProductDetails_swiperDotfd1_0 {
		position: absolute;
		bottom: 20rpx;
		left: 0rpx;
		right: 0rpx;
	}

	.pointsProductDetails_flex_2 {
		width: 750rpx;
		height: 108rpx;
		overflow: hidden;
		z-index: 10;
		bottom: calc(0rpx + var(--window-bottom));
	}

	.pointsProductDetails_fd2_1 {
		background: var(--benbenbgColor2);
		border-radius: 0rpx 0rpx 0rpx 0rpx;
		font-size: 32rpx;
		color: #fff;
		width: 750rpx;
		height: 108rpx;
		line-height: 108rpx;
		font-weight: 500;
	}

	.pointsProductDetails_fd2_0_c1 {
		color: #999999;
		font-size: 24rpx;
		font-weight: 400;
	}

	.pointsProductDetails_fd2_0_c0 {
		color: #999999;
		font-size: 32rpx;
		font-weight: 400;
	}

	.pointsProductDetails_fd2_0 {
		background: #eee;
		background-size: 100% auto !important;
		height: 108rpx;
		line-height: 108rpx;
	}
</style>